<!--
 * @Author: your name
 * @Date: 2020-12-28 17:53:01
 * @LastEditTime: 2020-12-29 14:27:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basicvue\vuehtml\vueindex.html
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../assets/css/common.css">
    <link rel="stylesheet" href="../assets/css/vue.css">
    <script src="../assets/js/vue.js"></script>
    <script src="../assets/js/jquery.js"></script>
</head>
<body>
<div id="app">
    <a href="../index.html" class="retu">BACK</a>
    <h1>实例</h1>
    <span>{{ message }}</span>
</div>
<script type="text/javascript">
    var app = new Vue({
        el : '#app',
        data : {
            message : 'hello world'
        },
        methods:{
            add:function(){
                console.log('调用了add方法')
            }
        },
        //在vue中使用jquery
        //可以在计算属性中使用,因为在计算属性中使用的时候DOM已经被加载完毕了
        mounted:function(){
            $('#app span').html('我是jquery,我被vue使用了');
        }
    });

    //实例调用自定义方法
    //实例调用
    console.log(app.add);

</script>
</body>
</html>